_realname=gtkhash
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=git
pkgrel=1
arch=( any )
pkgdesc="Desktop utility for computing message digests or checksums (mingw-w64)"
depends=(
	${MINGW_PACKAGE_PREFIX}-gtk3
	${MINGW_PACKAGE_PREFIX}-adwaita-icon-theme
	${MINGW_PACKAGE_PREFIX}-libgcrypt
)
makedepends=(
	${MINGW_PACKAGE_PREFIX}-pkg-config
	${MINGW_PACKAGE_PREFIX}-meson
	git
)
options=( strip )
license=( GPL )
url="https://github.com/tristanheaven/gtkhash"
install=${_realname}-${CARCH}.install
source=( ${_realname}.tar.gz )
sha256sums=( SKIP )

pkgver() {
	git describe --always | sed -e 's/v//' -e 's/-/+/g'
}

_getdir() {
	echo "${srcdir}/${_realname}"
}

build() {
	cd "$(_getdir)"
	meson setup \
		--prefix="/${MINGW_PREFIX}" \
		--buildtype=minsize \
		-Db_lto=true \
		-Dappstream=false \
		-Dblake2=false \
		_build
	meson compile -C _build
}

check() {
	cd "$(_getdir)/_build"
	meson test -v -t 2
}

package() {
	cd "$(_getdir)/_build"
	meson install --destdir "${pkgdir}"
}
